#include "ShapeFactory.h"

void Circle::draw(){
    std::cout << "Circle is rendered !" << std::endl;
}

void Rectangle::draw(){
    std::cout << "Rectangle is rendered !" << std::endl;
}

// 简单工厂类
std::unique_ptr<Shape> ShapeFactory::createShape(ShapeFactory::Type type){
    switch (type)
    {
    case Type::CIRCLE:
        return std::make_unique<Circle>();
    case Type::RECTANGLE:
        return std::make_unique<Rectangle>();
    default:
        return nullptr;
    }
}